package student.aistar.day12;

import java.math.BigDecimal;

public class BigDecimalHandlerFloatDemo {
    public static void main(String[] args) {
        BigDecimal d1 = new BigDecimal("0.1");
        BigDecimal d2 = new BigDecimal(String.valueOf(0.2));

        BigDecimal result = d1.add(d2);

        //BigDecimal -> double
        double resultDouble = result.doubleValue();
        System.out.println(resultDouble);

        System.out.println(result);
    }
}
